import Vue from 'vue'
import Vuex from 'vuex'
import {
  arena,
  user
} from './modules'
import getters from './getters'
import { getMeixingUrl } from '@/utils/util.js'

const shopUrl = getMeixingUrl()

Vue.use(Vuex)

const store = new Vuex.Store({
	modules: {
		arena,
		user
	},
	
    state:{
        tabCurrent: 0,
		tabBarList: [{
				"pagePath": "/pages/index/index",
				"text": "首页",
				"iconPath": "/static/imgs/tab-index.png",
				"selectedIconPath": "/static/imgs/tab-index@selected.png"
			},
			{
				"pagePath": "/pages/book-arena/book-arena",
				"text": "订场",
				"iconPath": "/static/imgs/tab-arena.png",
				"selectedIconPath": "/static/imgs/tab-arena@selected.png"
			},
			// {
			// 	"pagePath": "/pages/course/course",
			// 	"text": "课程",
			// 	"iconPath": "/static/imgs/tab-course.png",
			// 	"selectedIconPath": "/static/imgs/tab-course@selected.png"
			// },
			// {
			// 	"pagePath": shopUrl,
			// 	"web": true,
			// 	"text": "商城",
			// 	"iconPath": "/static/imgs/tab-shop.png",
			// 	"selectedIconPath": "/static/imgs/tab-shop@selected.png"
			// },
			{
				"pagePath": "/pages/mine/mine",
				"text": "我的",
				"iconPath": "/static/imgs/tab-mine.png",
				"selectedIconPath": "/static/imgs/tab-mine@selected.png"
			}
		]
    },
	
	getters: getters,
	
	mutations: {
		setTabCurrent: function(state, current) {
			state.tabCurrent = current
		}
	}
})
export default store